[Solved] Clever-way of putting a md5sum after source in PKGBUILD?

Been trying to find a way to do this.  'makepkg -g >> PKGBUILD' puts the md5sums at the end of the line and was hoping to find a way to put them after the source line.  Been thinking about a way to do this but it's pretty ugly.  Thinking something like this would do:
sed -e '1,/md5sum/d' PKGBUILD > PKGBUILD.tmp
sed -i '/md5sum/,/\t/d' PKGBUILD
makepkg -g PKGBUILD
cat PKGBUILD.tmp >> PKGBUILD
rm PKGBUILD.tmp
But thinking there's got to be a better way.  Has anyone come up (or have any ideas on how to) put md5sums after source?
Last edited by Gen2ly (2009-10-25 16:54:32)

I got a couple guys to help me out with this.  Awk it turns out is a much better way to do this.  Ah... awk.  Here's a more-awkward way of doing it:
awk 'BEGIN {
checkAt = 0
filesAt = 0
scanning = 0
/md5sums=\(/ {
checkAt = NR
scanning = 1
/source=\(/ {
filesAt = NR
scanning = 1
/)$/ {
if (scanning) {
if (checkAt > filesAt) {
checkEnd = NR
} else {
filesEnd = NR
scanning = 0
lines[NR] = $0
END {
for (i = 1; i <= NR; ++i) {
if (checkAt <= i && i <= checkEnd) {
continue
print lines[i]
if (i == filesEnd) {
for (j = checkAt; j <= checkEnd; ++j) {
print lines[j]
}' PKGBUILD > /tmp/PKGBUILD.tmp
mv /tmp/PKGBUILD.tmp PKGBUILD
This has the benefit of being able to put the md5sum after the source array even if it's before the source line.  Yah!

Similar Messages

  • I use a macbook pro retina. before i upgraded to maverick my windows stayed the way i put them. now after upgrade i have to resize every time i change the window. i use a 32in. monitor and use it full screen.

    I use a macbook pro retina.  I use a 32 in. monitor and use it full screen. I size the screen manually.  Since i upgraded to maverick, I have to resize the screen each time I change windows.Before the upgrade the screen stayed where I put it.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, or by a peripheral device. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode* and log in to the account with the problem. The instructions provided by Apple are as follows:
    Shut down your computer, wait 30 seconds, and then hold down the shift key while pressing the power button.
    When you see the gray Apple logo, release the shift key.
    If you are prompted to log in, type your password, and then hold down the shift key again as you click  Log in.
    *Note: If FileVault is enabled under OS X 10.7 or later, or if a firmware password is set, or if the boot volume is a software RAID, you can’t boot in safe mode. Safe mode is much slower to boot and run than normal, and some things won’t work at all, including wireless networking on certain Macs. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • Whats the easiest way to put a thin line around an image?

    Can anyone tell me the easiest way to put a thin line around
    an image? I'm also interested in the use of thin lines as part of
    the graphic design on a page, how are they generated?
    Thanks

    .oO(cdeatherage)
    >In Dreamweaver, you can set a border for each image but
    be aware that some
    >versions of some browsers may not display it.
    This shouldn't be an issue in any used browser today.
    >If it is a consistent look you're
    >after, I'd say the most permanent thing to do would be to
    edit the image in
    >Photoshop or Fireworks. In Photoshop, e.g, I'd create a
    background fill with
    >the color I wanted the border, then add the image,
    centered, in a new layer on
    >top of that. Merge the layers, then save optimized for
    the web.
    Way too complicated. If you want to change the color or style
    of the
    border, you have to modify the image. With CSS you can
    directly change
    the line style in a much easier and faster way.
    Micha

  • Is there a way to put facebook app back on my ipod touch 2nd gen?

    I have an ipod touch 2nd gen, when I first got it I put facebook app on it, I have had to restore it and now it says I need ios 4.3 which isn't available for 2nd gen, is there any other way to put the facebook app back on my ipod?

    Your only way is if you have the version that was compatible on your computer such as in the recycle bin/trash or in a computer file backup. In that case delete the current version that is in your iTunes App library and replace it with the older version. Then sync.
    Also see:
      Recover Older Versions of iPhone Apps After Updating — Apple News, Tips and Reviews

  • I wonder there is a way to put a query code when i make VSR.

    After applying vsr, program, GBTC2IQ0 is automatically generated. 
    I want to know what kind of naming rule is applied for this name(GBTC2IQ0).
    and where is it saved ?
    Also, I wonder there is a way to put a query code(like select...) when I make VSR.
    (* no badi.)

    Hello, check Finder Preferences>General, & then the Sidebar tab also.

  • Is there a way to put the songs from my ipod to my itunes???

    I think I did something and it erased some of my songs in the library but they are still on my ipod. what happened to the songs??? and is there a way to put the songs from my ipod onto my itunes?

    Perhaps you may
    i still
    have the music files on your PC -- but not seen in iTunes.
    Check using Windows Explorer in 'My Music\iTunes\iTunes Music\...' for folders containing your music (or wherever you keep your music folders). If it is there, we can get iTunes to recognize it. Try one or both of these:
    --- In iTunes choose: Edit==>Preferences==>Advanced tab. Select 'Change' and browse to the music folder in your PC drive (if it isn’t already). Click OK to save that setting.
    --- In iTunes choose: File==>’Add Folder to Library’ & browse to the music folder in your PC drive. Click OK.
    Also check in your Recycle Bin to see if you accidentally deleted it. If so, ‘Restore’ it back to it’s original spot.
    Then try running a search using Windows Explorer (or similar) for files with the extensions of: m4a, m4p, MP3,
    i OR
    with the partial names of the songs you are missing.
    Do all the above before you decide that they have been completely erased from your hard drive.
    If your music files are truly gone, and you have some or all of your music files on your iPod, these links will give you
    i several
    methods of recovering whatever songs remain on your iPod; some free, some third-party software, some more comprehensive for restoring playlists , ratings, counts, etc. Read them and their associated links before deciding on a strategy that works for you.
    How to import songs from your iPod to iTunes
    Use the iPod in its alter ego - that of portable computer disk drive
    Copying music from iPod to computer
    Copying Songs from Your iPod to a Mac or PC
    After recovering your song files, consider developing a backup strategy for just this type of situation. Below are some very good threads to read on the subject:
    StarDeb55, "Backing up music Please Help" #1, 10:04pm Jun 24, 2005 CDT
    Buegie, "Backing Up?" #1, 09:16am Jun 15, 2005 CDT

  • My laptop that had my iTunes on it has exploded (in a sense). I now have a new laptop, but I'm afraid to plug my iPod in because I know it will wipe out all 300 songs. Is there a way to put my old music on my new laptop?

    I now have a new laptop, but I'm afraid to plug my iPod in because I know it will wipe out all 300 songs. Is there a way to put my old music on my new laptop?
    (After my old laptop blew, it won't turn on anymore). I've invested quite a bit of money into my music, and it'd be a bummer if it's all gone to waste.
    Thanks in advance!

    Some of the information below has subsequently appeared in a document by turingtest2: Recovering your iTunes library from your iPod or iOS device - https://discussions.apple.com/docs/DOC-3991
    Your i-device was not designed for unique storage of your media. It is not a backup device and media transfer was designed for you maintaining a master copy of your media on a computer which is itself properly backed up against loss. Syncing is one way, computer to device, updating the device content to the content on the computer, not updating or restoring content on a computer. The exception is iTunes Store purchased content.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer - http://support.apple.com/kb/HT1848 - only media purchased from iTunes Store
    For transferring other items from an i-device to a computer you will have to use third party commercial software. Examples (check the web for others; this is not an exhaustive listing, nor do I have any idea if they are any good):
    - Senuti - http://www.fadingred.com/senuti/
    - Phoneview - http://www.ecamm.com/mac/phoneview/
    - MusicRescue - http://www.kennettnet.co.uk/products/musicrescue/
    - Sharepod (free) - http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2 - Windows
    - Snowfox/iMedia - http://www.mac-videoconverter.com/imedia-transfer-mac.html - Mac & PC
    - iexplorer (free) - http://www.macroplant.com/iexplorer/ - Mac&PC
    - Yamipod (free) - http://www.yamipod.com/main/modules/downloads/ - PC, Linux, Mac [Still updated for use on newer devices? No edits to site since 2010.]
    - 2010 Post by Zevoneer: iPod media recovery options - https://discussions.apple.com/message/11624224 - this is an older post and many of the links are also for old posts, so bear this in mind when reading them.
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive - https://discussions.apple.com/docs/DOC-3141 - dates from 2008 and some outdated information now.
    Copying Content from your iPod to your Computer - The Definitive Guide - http://www.ilounge.com/index.php/articles/comments/copying-music-from-ipod-to-co mputer/ - Information about use in disk mode pertains only to older model iPods.
    Get Your Music Off of Your iPod - http://howto.wired.com/wiki/Get_Your_Music_Off_of_Your_iPod - I am not sure but this may only work with some models and not newer Touch, iPhone, or iPad.
    Additional information here https://discussions.apple.com/message/18324797

  • Is there any way to put the values inthe system matrix which is non editabl

    is there any way to put the values inthe system matrix which is non editable...
    this Q is not that much priority since i had achieved the requirement other way round by having user defined matrix ... but if i get the way for this it will help my add on performance much better...

    Hi Raj, I didnt get all the details but here some ideas how you can solve your issue:
    Depending in the system form you are working you can always use a DBDataSource in order to manipulate the rows in a matrix. It's much better as using the objects of the matrix itself. In this case you can use:
    oMatrix.FlushToDataSource()
    oDBDsource.SetValue("U_Quan", pVal.Row, "101")
    oMatrix.Clear()
    oMatrix.LoadFromDataSource()
    As you can see in SetValue i'm obtaining the Column, then the row number and then setting a NEW value for this cell.
    Please consider if you can use DBDataSource instead of UserDataSource.
    If the answer is yes then you can use the following:
    oMatrix.FlushToDataSource()
    '//Get the line you want
    matrix.GetLineData(pval.row)
    '//Call the Userdatasource assigned to that column
    UserDataSource = UserDataSources.Item("ItmCode")
    '//Set the new value
    m_UserDS.ValueEx = "A02520"
    oMatrix.LoadFromDataSource()
    You can also use:
    oMatrix.Columns.Item("ItemName").Cells.Item(l_rownum).Specific.String = "A02520"
    In case you are not assigning the string in a combobox of course.
    Good luck!
    Felipe

  • Clever way to restrict insert on a table

    I'm on 10gR2, but will be on 11gR2 very soon (so if there are suggestions for 11g, prey tell).
    Security experts. I've read a lot on these forums of ways to secure oracle DBs, including database vault. I guess my requirement is somewhat simpler, and may not require the overheads of such a powerful tool.
    Requirement
    Generic database user will attempt to write a record to a table. The table will be owned by another database user with only insert priv assigned. This table will be a driving table which will be the key table in an integration of data that needs to be ultra secure. A record in this table will trigger important processing, so I need a way of restricting insert.
    I'm after some clever ways of only allowing inserts on the table if:
    - The user writing the record has insert priv (this I can handle)
    - The user writing the record is "authorised". Because the user writing the record will be a generic database user, that a lot of people have the password to, I need some way of implementing a fairly granular level of access. When I say "authorised", I don't really know what that means. It could perhaps mean that they have authenticated themselves somehow. It could mean that they are inserting only from an authorised "program". It could mean that they have some clever way of ensuring that they are the person who they say they are.
    I suppose that's the crux of my question. How can I ensure that a record that is written to a table comes from a reputable source, is authorised to insert, is not just someone inserting into the table ad-hoc, is who they say they are (i.e. not someone pretending to be someone or something else).
    Any advice?

    Hi There,
    For your needs, you need more environment factors to evaluate if a source is secure or not, (f. ex. IP Address), If you already identified all factors that you may use (client program, connection driver, ip address, os user, domain, etc.) you can use Secured Roles (no additional license costs for the enterprise edition).
    If not, and if you can afford a security architecture, I may suggest you to use Advanced Security Options to enable the "Strong Authentication" feature, you may use a Kerberos server, or link the authentication with a LDAP or even with the AD if you have one.
    Regards!

  • Is there a way of putting firefox bookmarks folder on the dock

    Is there a way of putting firefox bookmarks folder on the dock. not just one bookmark. i have done that. but i want all of them in stack or something.. similar to how windows did it in the start menu. its annoying that you have to open firefox first to access your links.
    i got my first imac yesterday and loving it!!! albeit the text is a bit small but i have found the zoom!
    thanks in advance

    Perhaps you don't know how to bring icons into the Firefox  Toolbar. You can put many things up there, including Bookmarks. You can also remove an icon or rearrange the order of icons.
    From View>Toolbars>Customize
    Here is the Bookmarks icon (next to the History icon) from which you can open all your bookmarks directly. And if you can remember a keyword, it will find that one, or any others that come up with that keyword. It's really quite convenient to use and will stay updated with any new bookmarks that are added.
    This is showing the Bookmarks open, which can be closed by clickng on the small x.

  • Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Hi! I need help, today I connected my mac Book Air to a tv for a presentation and as soon as I conected it the image on my screen went bigger. And I cant find the way to put it back as it was before. The Images are too big! heelp

    Morning DeeHutton,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at this article:
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/ts2802
    Best of luck,
    Mario

  • Is there a way to put the same event on multiple icloud calendars?

    Is there a way to put the same calendar entry on multiple calendars?  I have five children and most of them use their iTouch to keep there calendar.   My calendar is on icloud and I'd love it if they could see only their events but I need to see all of them.   Many of the events affect more than one child.

    As follow up to the above question,  I am the person putting items on the calendars.  I am not just trying to see calendars that they are maintaining. 

  • My wife and I share an account , is there a way to put both our contact lists in our one iCloud account without merging them., My wife and I share an account , is there a way to put both our contact lists in our one iCloud account without merging them.

    My wife and I both have iPhones and we share an apple ID. Is there a way to put both our contact list in the same iCloud without merging the lists.  We want to be able to use the same iCloud account because we share info .

    Welcome to the Apple community.
    No, there is no way of maintaining two separate contact lists with one account. Ideally you should each have your own iCloud account, you can still share your info by allowing each other to log into the other's account as a secondary account at settings >mail, contact, calendars. You can choose which services you choose to share and which you don't. This way you could maintain separate contact lists but still share them.

  • Is there a way to put the bluetooth icon on the homepage?

    I pair my iphone with my car when I'm driving. Is there a way to put the bluetooth icon on the homepage so I don't have to go through settings to turn the bluetooth on and off?
    I don't like to leave the bluetooth on all the time because it drains the battery, but it's kinda a pain to have to go through settings everytime I want to use this feature.
    On my last cell phone I could assign a "hot key" to automatically turn the bluetooth on and off. I really liked that. This bluetooth system seems a little dated to me.

    No not yet, hopfully soon.

  • Is there a way to put the cursor at a specific location in a RichTextBox?

    Is there a way to put the cursor at a specific location in a RichTextBox?
    The following code places the cursor at the start of a RichTextBox:
        RichTextBox RTbx
        RTbx.Focus();
        TextPointer tp = RTbx.CaretPosition;
        tp = tp.DocumentStart;
        RTbx.CaretPosition = tp;
    Not sure how to place it at a specific location other than start and end.
    The RichTextBox has contents.  At this point in the code, I do know the specific "word" in the contents, as well as the position (number of chars) where that word is located.  I just need to programmatically place the cursor at that location.
    bhs67

    Oh sorry, I see I missed something out my original reply.
    I have markup:
    <Grid>
    <RichTextBox Name="rtb">
    <FlowDocument>
    <Paragraph >This is the first paragraph</Paragraph>
    <Paragraph >TSecond paragraph is here</Paragraph>
    </FlowDocument>
    </RichTextBox>
    </Grid>
    Code - this is the window contentrendered event
    private void Window_ContentRendered(object sender, EventArgs e)
    rtb.Focus();
    // TextPointer moveTo = rtb.CaretPosition.GetNextInsertionPosition(LogicalDirection.Forward);
    TextPointer moveTo = rtb.CaretPosition.GetPositionAtOffset(9, LogicalDirection.Forward);
    if (moveTo != null)
    rtb.CaretPosition = moveTo;
    I see the cursor between the t and he of the second "the".
    Note that there are numerous other options such as the commented out line.
    Hope that helps.
    Recent Technet articles: Property List Editing;
    Dynamic XAML

Maybe you are looking for